<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>网站配置</title>
    {sys:load href="admin/css/bootstrap.min.css,admin/css/materialdesignicons.min.css,admin/css/style.min.css"}
</head>

<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <ul class="nav nav-tabs page-tabs">
                    <li class="active"> <a href="javascript:void(0)">网站设置</a> </li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active">

                        <form action="/app/cms/admin.index/systemdata" method="post" name="edit-form" class="edit-form" id="web_config">

                            <div class="form-group">
                                <label for="webname">网站名称:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="webname" name="webname" value="{$config.webname}" placeholder="网站名称" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="website">网站地址:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="website" name="website" value="{$config.website}" placeholder="网站地址:http://www.ys.com" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="logo">网站LOGO:</label>
                                <div class="input-group">
                                    <input type="text" class="form-control" name="logo" id="logo" value="{$config->getData('logo')}" />
                                    <div class="input-group-btn"><button class="btn btn-default upload" type="button">上传图片</button></div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="copyright">版权信息:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="copyright" name="copyright" value="{$config.copyright}" placeholder="" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="icp">ICP备案号:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="icp" name="icp" value="{$config.icp}" placeholder="" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="total_code">统计代码:</label>
                                <div class="controls-box">
                                    <textarea class="form-control" id="total_code" rows="5" name="total_code" placeholder="" >{$config.total_code}</textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="seo_title">SEO 标题:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="seo_title" name="seo_title" value="{$config.seo_title}" placeholder="" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="seo_keyword">SEO 关键字:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="seo_keyword" name="seo_keyword" value="{$config.seo_keyword}" placeholder="" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="seo_desc">SEO 描述:</label>
                                <div class="controls-box">
                                    <textarea class="form-control" id="seo_desc" rows="5" name="seo_desc" placeholder="" >{$config.seo_desc}</textarea>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="company">公司名称:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="company" name="company" value="{$config.company}" placeholder="" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="company_address">公司地址:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="company_address" name="company_address" value="{$config.company_address}" placeholder="" >
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="company_phone">公司电话:</label>
                                <div class="controls-box">
                                    <input class="form-control" type="text" id="company_phone" name="company_phone" value="{$config.company_phone}" placeholder="" >
                                </div>
                            </div>

                            <div class="form-group">
                                <button type="button" class="btn btn-primary m-r-5 btn-submit" form-id="web_config">确 定</button>
                            </div>
                        </form>

                    </div>
                </div>

            </div>
        </div>

    </div>

</div>
{sys:load href="admin/lib/layui/layui.js,admin/common.js"}

<script type="text/javascript">
    layui.use(['upload', 'layer', 'jquery', 'Request'], function(){
        var upload = layui.upload,layer = layui.layer, $ = layui.jquery , request = layui.Request;
        var uploader = upload.render({
            elem: '.upload',
            url: '/admin/index/uploader?dis=system',
            done: function( response , index, upload ) {
                if ( response.state == 'success' ) {
                    $("#logo").val(response.data.path);
                    layer.msg('上传成功!')
                } else {
                    layer.msg( response.message );
                }
            }
        });

        $(".btn-submit").click(function(){
            request.postInSubmit(".btn-submit", function(response){
                layer.msg('操作成功', {time:1000}, function(){
                    window.location.reload();
                })
            })
        });
    })
</script>

</body>
</html>
